//
//  vdMisc.h
//  Void Dead
//
//  Created by Sidney Just on 20.11.09.
//
//  Copyright © 2009 by Sidney Just
//  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
//  documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
//  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 
//  and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
//  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
//  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
//  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

#import "vdHeader.h"

#ifdef __cplusplus
extern "C" {
#endif
	
	/**
	 * \defgroup Misc Misc
	 */
	/*@{*/	
		
	/**
	 * Function to measure time. The function will return the time that has passed since the last call as NSTimeInterval.
	 @return The time thas has passed since the last timer() call
	 **/
	NSTimeInterval timer();

	/**
	 * Converts the given angle from degrees to radian
	 @param degrees The input angle
	 @return The input angle in radian
	 **/
	static __inline__ float degreesToRadian(float degrees)
	{
		return degrees * (M_PI / 180);
	}

	/**
	 * Converts the given angle from radian to degrees
	 @param radian The input angle
	 @return The input angle in degrees
	 **/
	static __inline__ float radianToDegrees(float radian)
	{
		return radian * (180 / M_PI);
	}

	/**
	 * Enables the given OpenGL state.
	 @param _enum The state you want to enable
	 **/
	void vdEnable(GLenum _enum);
	
	/**
	 * Disables the given OpenGL state.
	 @param _enum The state you want to disable
	 **/
	void vdDisable(GLenum _enum);

	/**
	 * Enables the given OpenGL client state.
	 @param _enum The state you want to enable
	 **/
	void vdEnableClientState(GLenum _enum);
	
	/**
	 * Disables the given OpenGL client state.
	 @param _enum The state you want to disable
	 **/
	void vdDisableClientState(GLenum _enum);
	
	/*@}*/

#ifdef __cplusplus
}
#endif	